\(\int x \cosh (\frac {1}{4}+x+x^2) \, dx\) [12]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [C] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 11, antiderivative size = 52 \[ \int x \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{8} \sqrt {\pi } \text {erf}\left (\frac {1}{2} (-1-2 x)\right )-\frac {1}{8} \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (1+2 x)\right )+\frac {1}{2} \sinh \left (\frac {1}{4}+x+x^2\right ) \]

[Out]

1/2*sinh(1/4+x+x^2)-1/8*erf(1/2+x)*Pi^(1/2)-1/8*erfi(1/2+x)*Pi^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.455, Rules used = {5491, 5483, 2266, 2235, 2236} \[ \int x \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{8} \sqrt {\pi } \text {erf}\left (\frac {1}{2} (-2 x-1)\right )-\frac {1}{8} \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (2 x+1)\right )+\frac {1}{2} \sinh \left (x^2+x+\frac {1}{4}\right ) \]

[In]

Int[x*Cosh[1/4 + x + x^2],x]

[Out]

(Sqrt[Pi]*Erf[(-1 - 2*x)/2])/8 - (Sqrt[Pi]*Erfi[(1 + 2*x)/2])/8 + Sinh[1/4 + x + x^2]/2

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 2266

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 5483

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[1/2, Int[E^(a + b*x + c*x^2), x], x] + Dist[1/2
, Int[E^(-a - b*x - c*x^2), x], x] /; FreeQ[{a, b, c}, x]

Rule 5491

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[e*(Sinh[a + b*x + c*x^2]/(
2*c)), x] - Dist[(b*e - 2*c*d)/(2*c), Int[Cosh[a + b*x + c*x^2], x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b*
e - 2*c*d, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \sinh \left (\frac {1}{4}+x+x^2\right )-\frac {1}{2} \int \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx \\ & = \frac {1}{2} \sinh \left (\frac {1}{4}+x+x^2\right )-\frac {1}{4} \int e^{-\frac {1}{4}-x-x^2} \, dx-\frac {1}{4} \int e^{\frac {1}{4}+x+x^2} \, dx \\ & = \frac {1}{2} \sinh \left (\frac {1}{4}+x+x^2\right )-\frac {1}{4} \int e^{-\frac {1}{4} (-1-2 x)^2} \, dx-\frac {1}{4} \int e^{\frac {1}{4} (1+2 x)^2} \, dx \\ & = \frac {1}{8} \sqrt {\pi } \text {erf}\left (\frac {1}{2} (-1-2 x)\right )-\frac {1}{8} \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (1+2 x)\right )+\frac {1}{2} \sinh \left (\frac {1}{4}+x+x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.46 \[ \int x \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {2 \left (-1+\sqrt {e}\right ) \cosh (x (1+x))-\sqrt [4]{e} \sqrt {\pi } \text {erf}\left (\frac {1}{2}+x\right )-\sqrt [4]{e} \sqrt {\pi } \text {erfi}\left (\frac {1}{2}+x\right )+2 \left (1+\sqrt {e}\right ) \sinh (x (1+x))}{8 \sqrt [4]{e}} \]

[In]

Integrate[x*Cosh[1/4 + x + x^2],x]

[Out]

(2*(-1 + Sqrt[E])*Cosh[x*(1 + x)] - E^(1/4)*Sqrt[Pi]*Erf[1/2 + x] - E^(1/4)*Sqrt[Pi]*Erfi[1/2 + x] + 2*(1 + Sq
rt[E])*Sinh[x*(1 + x)])/(8*E^(1/4))

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.05 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.94

method result size
risch \(-\frac {{\mathrm e}^{-\frac {\left (1+2 x \right )^{2}}{4}}}{4}-\frac {\operatorname {erf}\left (\frac {1}{2}+x \right ) \sqrt {\pi }}{8}+\frac {{\mathrm e}^{\frac {\left (1+2 x \right )^{2}}{4}}}{4}+\frac {i \sqrt {\pi }\, \operatorname {erf}\left (i x +\frac {1}{2} i\right )}{8}\) \(49\)

[In]

int(x*cosh(1/4+x+x^2),x,method=_RETURNVERBOSE)

[Out]

-1/4*exp(-1/4*(1+2*x)^2)-1/8*erf(1/2+x)*Pi^(1/2)+1/4*exp(1/4*(1+2*x)^2)+1/8*I*Pi^(1/2)*erf(I*x+1/2*I)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 106 vs. \(2 (28) = 56\).

Time = 0.25 (sec) , antiderivative size = 106, normalized size of antiderivative = 2.04 \[ \int x \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {2 \, \cosh \left (x^{2} + x + \frac {1}{4}\right )^{2} + 4 \, \cosh \left (x^{2} + x + \frac {1}{4}\right ) \sinh \left (x^{2} + x + \frac {1}{4}\right ) + 2 \, \sinh \left (x^{2} + x + \frac {1}{4}\right )^{2} - \sqrt {\pi } {\left (\cosh \left (x^{2} + x + \frac {1}{4}\right ) \operatorname {erf}\left (x + \frac {1}{2}\right ) + \cosh \left (x^{2} + x + \frac {1}{4}\right ) \operatorname {erfi}\left (x + \frac {1}{2}\right ) + {\left (\operatorname {erf}\left (x + \frac {1}{2}\right ) + \operatorname {erfi}\left (x + \frac {1}{2}\right )\right )} \sinh \left (x^{2} + x + \frac {1}{4}\right )\right )} - 2}{8 \, {\left (\cosh \left (x^{2} + x + \frac {1}{4}\right ) + \sinh \left (x^{2} + x + \frac {1}{4}\right )\right )}} \]

[In]

integrate(x*cosh(1/4+x+x^2),x, algorithm="fricas")

[Out]

1/8*(2*cosh(x^2 + x + 1/4)^2 + 4*cosh(x^2 + x + 1/4)*sinh(x^2 + x + 1/4) + 2*sinh(x^2 + x + 1/4)^2 - sqrt(pi)*
(cosh(x^2 + x + 1/4)*erf(x + 1/2) + cosh(x^2 + x + 1/4)*erfi(x + 1/2) + (erf(x + 1/2) + erfi(x + 1/2))*sinh(x^
2 + x + 1/4)) - 2)/(cosh(x^2 + x + 1/4) + sinh(x^2 + x + 1/4))

Sympy [F]

\[ \int x \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx=\int x \cosh {\left (x^{2} + x + \frac {1}{4} \right )}\, dx \]

[In]

integrate(x*cosh(1/4+x+x**2),x)

[Out]

Integral(x*cosh(x**2 + x + 1/4), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 123 vs. \(2 (28) = 56\).

Time = 0.27 (sec) , antiderivative size = 123, normalized size of antiderivative = 2.37 \[ \int x \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{2} \, x^{2} \cosh \left (x^{2} + x + \frac {1}{4}\right ) + \frac {{\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac {3}{2}, \frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}{4 \, {\left ({\left (2 \, x + 1\right )}^{2}\right )}^{\frac {3}{2}}} - \frac {{\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}{4 \, \left (-{\left (2 \, x + 1\right )}^{2}\right )^{\frac {3}{2}}} - \frac {1}{16} \, e^{\left (\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )} - \frac {1}{16} \, e^{\left (-\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )} - \frac {1}{4} \, \Gamma \left (2, \frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right ) + \frac {1}{4} \, \Gamma \left (2, -\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right ) \]

[In]

integrate(x*cosh(1/4+x+x^2),x, algorithm="maxima")

[Out]

1/2*x^2*cosh(x^2 + x + 1/4) + 1/4*(2*x + 1)^3*gamma(3/2, 1/4*(2*x + 1)^2)/((2*x + 1)^2)^(3/2) - 1/4*(2*x + 1)^
3*gamma(3/2, -1/4*(2*x + 1)^2)/(-(2*x + 1)^2)^(3/2) - 1/16*e^(1/4*(2*x + 1)^2) - 1/16*e^(-1/4*(2*x + 1)^2) - 1
/4*gamma(2, 1/4*(2*x + 1)^2) + 1/4*gamma(2, -1/4*(2*x + 1)^2)

Giac [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.27 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.83 \[ \int x \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx=-\frac {1}{8} \, \sqrt {\pi } \operatorname {erf}\left (x + \frac {1}{2}\right ) - \frac {1}{8} i \, \sqrt {\pi } \operatorname {erf}\left (-i \, x - \frac {1}{2} i\right ) + \frac {1}{4} \, e^{\left (x^{2} + x + \frac {1}{4}\right )} - \frac {1}{4} \, e^{\left (-x^{2} - x - \frac {1}{4}\right )} \]

[In]

integrate(x*cosh(1/4+x+x^2),x, algorithm="giac")

[Out]

-1/8*sqrt(pi)*erf(x + 1/2) - 1/8*I*sqrt(pi)*erf(-I*x - 1/2*I) + 1/4*e^(x^2 + x + 1/4) - 1/4*e^(-x^2 - x - 1/4)

Mupad [F(-1)]

Timed out. \[ \int x \cosh \left (\frac {1}{4}+x+x^2\right ) \, dx=\int x\,\mathrm {cosh}\left (x^2+x+\frac {1}{4}\right ) \,d x \]

[In]

int(x*cosh(x + x^2 + 1/4),x)

[Out]

int(x*cosh(x + x^2 + 1/4), x)